package com.lifeng.system.service.impl;

import com.lifeng.system.mapper.TOrderMapper;
import com.lifeng.system.mapper.TOrderinfoMapper;
import com.lifeng.system.pojo.TOrderinfo;
import com.lifeng.system.service.ITOrderinfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 李峰
 * @since 2022-11-26
 */
@Service
public class TOrderinfoServiceImpl extends ServiceImpl<TOrderinfoMapper, TOrderinfo> implements ITOrderinfoService {

    @Autowired
    private TOrderMapper tOrderMapper;

    /**
     * 因为一个订单会有多个商品
     * 将用户购买的多条记录添加到订单详情表中
     * @param tOrderinfoList
     */
    @Override
    public void addOrderInfo(List<TOrderinfo> tOrderinfoList) {
        tOrderMapper.insertOrderInfos(tOrderinfoList);
    }
}
